package com.hfut.wxy.controller;

import com.hfut.wxy.common.response.Response;
import com.hfut.wxy.entity.mysql.WxyFeedback;
import com.hfut.wxy.entity.mysql.WxyUserInfo;
import com.hfut.wxy.service.IUserCenterService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "个人中心")
@RestController
public class UserCenterController {
    @Resource
    private IUserCenterService userCenterService;

    @ApiOperation("1 更新完善个人信息")
    @PostMapping("/center/update")
    public Response completeInfo(@RequestBody WxyUserInfo wxyUserInfo){
        return Response.success(userCenterService.completeInfo(wxyUserInfo));
    }

    @ApiOperation("2 用户数据")
    @PostMapping("/center/count/{userId}")
    public Response count(@PathVariable Integer userId){
        return Response.success(userCenterService.count(userId));
    }

    @ApiOperation("3 用户反馈")
    @PostMapping("/feedback")
    public Response feedback(@RequestBody WxyFeedback feedback){
        return Response.success(userCenterService.feedback(feedback));
    }




}
